From fe12eca91d6132600f3e0e97471dbfd7a70911da Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Thu, 10 Oct 2024 13:26:23 -0500 Subject: [PATCH] Add feature to upload missing column values as NULL --- examples/etc/pgwui.yaml | 17 +++++++++++++++++ examples/misc/development.yaml | 29 +++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/examples/etc/pgwui.yaml b/examples/etc/pgwui.yaml index 0712b33..2145750 100644 --- a/examples/etc/pgwui.yaml +++ b/examples/etc/pgwui.yaml @@ -247,6 +247,7 @@ app: # trim: 'choice-yes' # null: 'choice-yes' # file_format: 'csv' + # add_missing_columns: 'no-never' # # literal_column_headings # Take uploaded column headings literally? @@ -288,6 +289,17 @@ app: # The available choices are: # csv The CSV format. (default) # tab Tab separated values. + # + # add_missing_columns + # Add columns instead of reporting an error when a uploaded row has + # fewer columns than are present in the column headings given in the + # first row. The added values are presented to Postgres as NULL values. + # The available choices are: + # yes-always Always add missing column values. + # choice-yes Present a checkbox, default to "yes". + # choice-no Present a checkbox, default to "no". + # no-never Always report an error when a row has too few columns. + # Optional setting. The default is "no-never". # pgwui_bulk_upload @@ -299,6 +311,7 @@ app: # trim: 'choice-yes' # null: 'choice-yes' # file_format: 'csv' + # add_missing_columns: 'no-never' # # literal_column_headings: 'no-never' (default) # Take uploaded column headings literally? @@ -356,6 +369,10 @@ app: # file_format: 'csv' (default) # The format of the uploaded files. # See pgwui_upload above for details. + # + # add_missing_columns: 'no-never' (default) + # Add columns when rows are too short. + # See pgwui_upload above for details. # pgwui_upcen diff --git a/examples/misc/development.yaml b/examples/misc/development.yaml index 38b6971..ab5e21e 100644 --- a/examples/misc/development.yaml +++ b/examples/misc/development.yaml @@ -240,12 +240,13 @@ app: # pgwui_upload # The default pgwui_upload settings are: - #pgwui_upload: - # literal_column_headings: 'no-never' - # menu_label: 'upload -- Upload File Into Database' - # trim: 'choice-yes' - # null: 'choice-yes' - # file_format: 'csv' + # pgwui_upload: + # literal_column_headings: 'no-never' + # menu_label: 'upload -- Upload File Into Database' + # trim: 'choice-yes' + # null: 'choice-yes' + # file_format: 'csv' + # add_missing_columns: 'no-never' # # literal_column_headings # Take uploaded column headings literally? @@ -287,6 +288,17 @@ app: # The available choices are: # csv The CSV format. # tab Tab separated values. + # + # add_missing_columns + # Add columns instead of reporting an error when a uploaded row has + # fewer columns than are present in the column headings given in the + # first row. The added values are presented to Postgres as NULL values. + # The available choices are: + # yes-always Always add missing column values. + # choice-yes Present a checkbox, default to "yes". + # choice-no Present a checkbox, default to "no". + # no-never Always report an error when a row has too few columns. + # Optional setting. The default is "no-never". # pgwui_bulk_upload @@ -298,6 +310,7 @@ app: # trim: 'choice-yes' # null: 'choice-yes' # file_format: 'csv' + # add_missing_columns: 'no-never' # # literal_column_headings: 'no-never' # Take uploaded column headings literally? @@ -355,6 +368,10 @@ app: # file_format: 'csv' # The format of the uploaded files. # See pgwui_upload above for details. + # + # add_missing_columns: 'no-never' (default) + # Add columns when rows are too short. + # See pgwui_upload above for details. # pgwui_upcen -- 2.34.1